<template>
  <d2-container :filename="filename" type="card">
    <template slot="header">分区管理</template>

    <el-row>
      <el-col :span="16">
        <partition-list ref="list" @edit="doEdit"></partition-list>
      </el-col>
      <el-col :span="7" :offset="1">
        <div style="height:64px"></div>
        <partition-create @saved="refreshList" v-model="partition"></partition-create>
      </el-col>
    </el-row>

  </d2-container>
</template>

<script>
import Vue from "vue";

import PartitionCreate from "./create.vue";
import PartitionList from "./list.vue";

export default {
    name: "client-index",
    data() {
        return {
            filename: __filename,
            /**请求接口返回 */
            paged: {},
            partition: {}
        };
    },

    components: {
        "partition-create": PartitionCreate,
        "partition-list": PartitionList
    },
    methods: {
        refreshList: function() {
            this.$refs["list"].fetch();
        },
        doEdit: function(partition) {
            this.partition = Object.assign({}, partition);
        }
    }
};
</script>
